You can help by commenting or suggesting your edit directly into the transcript. We'll review any changes before posting them. All comments are completely anonymous. For any comments that need a reply, consider emailing training@inductiveautomation.com.
Version:
LESSON LIST
-
5:12Scripting Functions
-
3:27Scheduling Actions - Save, Print and FTP
-
3:23Scheduling Actions - Email
Take Topic Challenge
Supplemental Videos
LESSON
Scheduling Actions - Save, Print and FTP
Description
Learn how to create actions that save and print a report immediately or on at a scheduled date.
Video recorded using: Ignition 8.1
Transcript
(open in window)[00:00] Let's take a look at some of the actions your scheduled reports can take. You can see I'm in the preview tab of this equipment downtime report I've created, and it's all set up so we are ready to use a schedule. We'll head over to the schedule tab and you can see I have a schedule all set up. This schedule is going to run every day at midnight. Let's go ahead and add a new action by switching over to the actions tab. Then we'll click on the add new action icon. Let's start by choosing a new print action. The print action is used to send a report to a printer that is accessible from a computer ignition is installed on. Looking at our properties, we are able to set both a primary printer and a backup printer in case the primary printer fails. The print mode lets us decide if we want the report printed with either vector or raster graphics. When we select raster, this DPI option lets us control the amount of dots or pixels per inch. We can increase the number of copies that are printed. Below this we have some options where we can choose how the printing is done.
[01:06] Printing on both sides will attempt to print on both sides of a sheet of paper if supported by the printer. Collate orders the pages so that a complete report prints before the next copy prints if applicable. Finally, the auto landscape mode evaluates the page dimensions and determines portrait or landscape orientation. We can also set the page orientation to either portrait or landscape. Now, a nice feature of scheduled actions is that you can actually run multiple actions at the same time. So say we'd want to save a backup of this report to a file server. Let's add a new action and choose the new FTP action. With the FTP action, we can specify your server address, what port to use and user credentials ignition should be using, and then you can select if you need to use SSL or not. Next, you can specify a folder path, a file name, and what format you want to save the report in. The file name has an expression built by default, but you can alter it as you like and you can use any of your parameters or tags, and there's even some built-in parameters you can use here, such as report name, which is what the expression is using already.
[02:11] If I click on format, you'll see we get a number of format options to choose from. It's important to note that the XLS and XLSX format options may return less than pixel perfect results. This is due to how many spreadsheet programs interpret the resulting file. As a result, the PDF format is recommended in most cases. If you're not using an FTP server to save your reports, you can also use a new save file action to save a copy of the report to any folder the ignition server has access to, such as a local folder or network shared drive. Again, we have to specify a folder path, so I'll save this report to my reports folder within my C drive. We also have the same option seen in the FTP action of the filename and format. Sometimes you might not want to wait for the report schedule to trigger an action. If you wanted to trigger an action on demand, you can use this run selected action immediately icon to execute the selected action.
[03:06] In this case, clicking on the icon, will save the report to my reports folder. I'll go ahead and open the report and we can see it successfully exported as a PDF. So whether you want the report saved somewhere or just print it out, maybe even both, you can very easily create the desired actions you would like to run.